package com.example.demo.dao;

import com.example.demo.entity.Book;
import com.example.demo.mapper.BookMapper;
import com.example.demo.sharding.RouteModel;
import com.example.demo.sharding.annotation.NeedRoute;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookDaoImpl implements BookDao {

    @Autowired
    private BookMapper bookMapper;

    @Override
    public List<Book> list() {
        return bookMapper.list();
    }

    @Override
    @NeedRoute
    public Book findByRout(RouteModel routeModel) {

        return bookMapper.findByRout(routeModel);

    }
}
